/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <gtest/gtest.h>

#include "sle_ssap_server_server.h"
#include "sle_ssap_server_callback_stub.h"

class SleSsapServerCallbackTest : public testing::Test {
public:
    static void SetUpTestCase();
    static void TearDownTestCase();
    void SetUp() override;
    void TearDown() override;

};
void SleSsapServerCallbackTest::SetUp(){}
void SleSsapServerCallbackTest::TearDown(){}
void SleSsapServerCallbackTest::SetUpTestCase(){}
void SleSsapServerCallbackTest::TearDownTestCase(){}

namespace OHOS {
namespace NearLink {
namespace SleStandard {
class SleSsapServerCallbackStubMock : public SleSsapServerCallbackStub {
public:
    void OnStartService(uint8_t serverId, uint16_t handle, uint32_t errCode)
    {

    }
    void OnAllServiceDelete(uint8_t serverId, uint32_t errCode)
    {

    }
    void OnReadRequest(
    uint8_t serverId, uint16_t connectId, const SsapServerReqReadCbParam &param, uint32_t errCode)
    {

    }
    void OnWriteRequest(
    uint8_t serverId, uint16_t connectId, const SsapServerReqWriteCbParam &param, uint32_t errCode)
    {

    }
    void OnMtuInfoChanged(
    uint8_t serverId, uint16_t connectId, uint32_t mtu, uint16_t version, uint32_t errCode)
    {

    }
};


HWTEST_F(SleSsapServerCallbackTest, RegisterSeekCallback_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;
    Uuid uuid;
    uint8_t clientId = 0;
    sptr<SleSsapServerCallbackStubMock> callback = new SleSsapServerCallbackStubMock();
    SleErrorCode result = ssssserver.RegisterSsapServer(uuid, clientId, callback);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}


HWTEST_F(SleSsapServerCallbackTest, UnregisterSsapServer_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0;
    sptr<SleSsapServerCallbackStubMock> callback = new SleSsapServerCallbackStubMock();
    SleErrorCode result = ssssserver.UnregisterSsapServer( serverId, callback);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}


HWTEST_F(SleSsapServerCallbackTest, AddService_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0; Uuid uuid;
    bool isPrimary = true;
    uint16_t handle = 0;
    SleErrorCode result = ssssserver.AddService( serverId,  uuid, isPrimary,  handle);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}


HWTEST_F(SleSsapServerCallbackTest, AddProperty_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0; uint16_t serviceHandle = 0; SsapServerPropertyParam param; uint16_t handle = 1;
    SleErrorCode result = ssssserver.AddProperty( serverId,  serviceHandle,   param, handle);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}


HWTEST_F(SleSsapServerCallbackTest, AddDescriptor_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0; uint16_t serviceHandle = 0; uint16_t propHandle = 1; SsapServerDescriptorParam param;
    SleErrorCode result = ssssserver.AddDescriptor( serverId,  serviceHandle,  propHandle,   param);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}

HWTEST_F(SleSsapServerCallbackTest, RemoveAllServices_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0;
    SleErrorCode result = ssssserver.RemoveAllServices( serverId);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}


HWTEST_F(SleSsapServerCallbackTest, StartService_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0;
    uint16_t serviceHandle = 0;
    SleErrorCode result = ssssserver.StartService( serverId,  serviceHandle);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}



HWTEST_F(SleSsapServerCallbackTest, SendResponse_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0;
    uint16_t connectId = 0;
    SsapServerSendRspParam param;
    SleErrorCode result = ssssserver.SendResponse( serverId,  connectId,   param);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}

HWTEST_F(SleSsapServerCallbackTest, NotifyIndicate_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0;
    uint16_t connectId = 0;
    SsapServerNotifyParam param;
    SleErrorCode result = ssssserver.NotifyIndicate( serverId,  connectId,  param);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}


HWTEST_F(SleSsapServerCallbackTest, NotifyIndicateByUuid_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0;
    uint16_t connectId = 0;
    SsapServerNotyfyByUuidParam param;
    SleErrorCode result = ssssserver.NotifyIndicateByUuid( serverId, connectId,  param);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}

HWTEST_F(SleSsapServerCallbackTest, SetServerMtuInfo_001, testing::ext::TestSize.Level0)
{
    SleSsapServerServer ssssserver;

    uint8_t serverId = 0;
    uint32_t mtu = 0;
    uint16_t version = 0;
    SleErrorCode result = ssssserver.SetServerMtuInfo( serverId,  mtu,  version);
    ASSERT_EQ(SLE_ERR_FAILED, result);
}



}}}